import { createWebHashHistory, createRouter, createWebHistory } from "vue-router";
import Home from "@/views/Home/index.vue"
const routes = [
  {
    path: "/",
    name: "index",
    component: () => import("@/views/Home/index.vue"),
    meta: {
      title: "综合态势",
    },
  },
  {
    path: "/security",
    name: "security",
    // redirect: "/security/profile",
    component: () => import("@/views/Security/index.vue"),
    meta: {
      title: "综合安防",
    },
    children: [
      {
        path: "/security/profile",
        component: () => import("@/views/Security/charts/index.vue"),
      },
      {
        path: "/security/posts",
        component: () => import("@/views/Security/secur/index.vue"),
      },
    ],
  },
  {
    path: "/through",
    name: "through",
    // redirect: "/through/first",
    component: () => import("@/views/Through/index.vue"),
    meta: {
      title: "便捷通行",
    },
    // children: [
    //   {
    //     path: "/through/first",
    //     component: () => import("@/views/Through/First/index.vue"),
    //   },
    //   {
    //     path: "/through/secoud",
    //     component: () => import("@/views/Through/Secoud/index.vue"),
    //   },
    //   {
    //     path: "/through/posts",
    //     component: () => import("@/views/Security/secur/index.vue"),
    //   },
    // ],
  },
  {
    path: "/assets",
    name: "assets",
    // redirect: "/assets/first",
    component: () => import("@/views/assets/index.vue"),
    meta: {
      title: "资产管理",
    },
    // children: [
    //   {
    //     path: "/assets/first",
    //     component: () => import("@/views/assets/first/index.vue"),
    //   },
    //   {
    //     path: "/assets/secoud",
    //     component: () => import("@/views/assets/secoud/index.vue"),
    //   },
    //   {
    //     path: "/assets/posts",
    //     component: () => import("@/views/Security/secur/index.vue"),
    //   },
    // ],
  },
  {
    path: "/warning",
    name: "warning",
    // redirect: "/warning/first",
    component: () => import("@/views/warning/index.vue"),
    meta: {
      title: "智能预警",
    },
    children: [
      {
        path: "/warning/first",
        component: () => import("@/views/warning/first/index.vue"),
      },
      {
        path: "/warning/secoud",
        component: () => import("@/views/warning/secoud/index.vue"),
      },
      {
        path: "/warning/posts",
        component: () => import("@/views/Security/secur/index.vue"),
      },
    ],
  },
  {
    path: "/enery",
    name: "enery",
    // redirect: "/enery/first",
    component: () => import("@/views/Energy/index.vue"),
    meta: {
      title: "能效管理",
    },
    // children: [
    //   {
    //     path: "/enery/first",
    //     component: () => import("@/views/Energy/first/index.vue"),
    //   },
    //   {
    //     path: "/enery/posts",
    //     component: () => import("@/views/Security/secur/index.vue"),
    //   },
    // ],
  },
  {
    path: "/facility",
    name: "facility",
    // redirect: "/facility/first",
    component: () => import("@/views/facility/index.vue"),
    meta: {
      title: "设施管理",
    },
    // children: [
    //   {
    //     path: "/facility/first",
    //     component: () => import("@/views/facility/first/index.vue"),
    //   },
    //   {
    //     path: "/facility/posts",
    //     component: () => import("@/views/Security/secur/index.vue"),
    //   },
    // ],
  },
  {
    path: "/environment",
    name: "environment",
    // redirect: "/environment/first",
    component: () => import("@/views/environment/index.vue"),
    meta: {
      title: "环境空间",
    },
    // children: [
    //   {
    //     path: "/environment/first",
    //     component: () => import("@/views/environment/first/index.vue"),
    //   },
    //   {
    //     path: "/environment/posts",
    //     component: () => import("@/views/Security/secur/index.vue"),
    //   },
    // ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export default router;
